package main.Q1701_1800;

public class Q1761_1770 {
    public static void main(String[] args) {
        System.out.println("Question1761：");
        System.out.println("Question1762：");
        System.out.println("Question1763：");
        System.out.println("Question1764：");
        System.out.println("Question1765：");
        System.out.println("Question1766：");
        System.out.println("Question1767：");
        System.out.println("Question1768：交替合并字符串");
        System.out.println("Question1769：移动所有球到每个盒子所需的最小操作数");
        System.out.println("Question1770：");
    }
}

class Question1768 {
    public String mergeAlternately(String word1, String word2) {
        char[] str1 = word1.toCharArray(), str2 = word2.toCharArray();
        StringBuffer result = new StringBuffer();
        int i = 0, j = 0;
        while (i < str1.length || j < str2.length) {
            if (i < str1.length) {
                result.append(str1[i]);
                i++;
            }
            if (j < str2.length) {
                result.append(str2[j]);
                j++;
            }
        }
        return result.toString();
    }
}

class Question1769 {
    public int[] minOperations(String boxes) {
        int n = boxes.length();
        int[] result = new int[n];
        for (int i = 0; i < n; i++) {
            int sm = 0;
            for (int j = 0; j < n; j++) {
                if (boxes.charAt(j) == '1') {
                    sm += Math.abs(j - i);
                }
            }
            result[i] = sm;
        }
        return result;
    }
}